﻿using System.Threading.Tasks;

namespace Sidvall.Devices
{
    public class GeolocatorFactoryManager
    {
        #region Public Members

        public Sidvall.Devices.IGeolocatorFactory GeolocatorFactory { get; set; }

        #region CreateGeolocatorAsync

        public async Task<IGeolocator> CreateGeolocatorAsync()
        {
            if (this.GeolocatorFactory != null)
                return await this.GeolocatorFactory.CreateGeolocatorAsync().ConfigureAwait(false);
            return null;
        }

        #endregion
        #region ToString

        public override string ToString()
        {
            return "GeolocatorFactoryManager - Sidvall.Devices.IGeolocatorFactory";
        }

        #endregion

        #endregion
        #region Constructors

        public GeolocatorFactoryManager(Sidvall.Devices.IGeolocatorFactory geolocatorFactory)
        {
            this.GeolocatorFactory = geolocatorFactory;
        }

        #endregion
    }
}
